package com.qf.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author：刘亚康
 * @Date：2020/4/7
 * @QQ：50770284
 * @Phone：18235947935
 * @Desc : 用户名邮箱验证时返回类
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultCheckData {
    private String info;

    private String status;

    private static final String STATUS_SUCCESS="y";

    private static final String INFO_USERNAME_SUCCESS="用户名唯一";

    private static final String INFO_MAIL_SUCCESS="邮箱唯一";

    private static final String STATUS_FAIL="n";

    private static final String INFO_USERNAME_FAIL="用户名已存在";

    private static final String INFO_MAIL_FAIL="邮箱已存在";

    /**
     * 用户名验证成功的返回消息
     * @return
     */
    public static ResultCheckData usernameSuccess(){
        return new ResultCheckData(INFO_USERNAME_SUCCESS,STATUS_SUCCESS);
    }

    /**
     * 用户名验证失败的返回消息
     * @return
     */
    public static ResultCheckData usernameFail(){
        return new ResultCheckData(INFO_USERNAME_FAIL,STATUS_FAIL);
    }

    /**
     * 成功时的自定义消息
     * @param info
     * @return
     */
    public static ResultCheckData SUCCESS_MSG(String info){
        return new ResultCheckData(info,STATUS_SUCCESS);
    }
    /**
     * 失败时的自定义消息
     * @param info
     * @return
     */
    public static ResultCheckData FAIL_MSG(String info){
        return new ResultCheckData(info,STATUS_FAIL);
    }
    /**
     * 邮箱验证成功的返回消息
     * @return
     */
    public static ResultCheckData mailSuccess(){
        return new ResultCheckData(INFO_MAIL_SUCCESS,STATUS_SUCCESS);
    }

    /**
     * 邮箱验证失败的返回消息
     * @return
     */
    public static ResultCheckData mailFail(){
        return new ResultCheckData(INFO_MAIL_FAIL,STATUS_FAIL);
    }
}
